//测试-二叉树
//编译：g++ TestRedBlackTree.cpp ../../*/*/RedBlackTree.hpp -o test
#ifndef __TESTREDBLACKTREE__CPP
#define __TESTREDBLACKTREE__CPP

#include<iostream>
#include"../../DataStructure/Tree/RedBlackTree.hpp"

using namespace std;
using namespace NgSiuKei;

int main(void) {
    int num;
    cout << "输入数量：";
    cin >> num;

    int val;
    cout << "输入值插入数据：";
    cin >> val;
    binary_tree_node<int> *tree = createRedBlackTree(&val, 1);
    printRedBlackTree(tree);
    for(int i=1; i<num; ++i) {
        cout << "输入值插入数据：";
        cin >> val;
        insertValIntoRedBlackTree(tree, val);
        printRedBlackTree(tree);
    }

    for(int i=0; i<num; ++i) {
        cout << "输入值删除数据：";
        cin >> val;
        deleteValFromRedBlackTree(tree, val);
        printRedBlackTree(tree);
    }

    return 0;
}

#endif